package com.xyy.dfapi.pojo;

import lombok.Data;

@Data
public class ErpResultDto<T> {
    /**
     * 提示信息
     */
    private String message;

    /**
     * 业务数据
     */
    private T result;

    /**
     * 状态码
     * 200	OK
     * 201	Created
     * 401	Unauthorized
     * 403	Forbidden
     * 404	Not Found
     */
    private Integer status;

    public  ErpResultDto buildFail(int code, String msg){
        ErpResultDto resultDTO = new ErpResultDto();
        resultDTO.setStatus(code);
        resultDTO.setMessage(msg);
        return resultDTO;
    }
}
